<?php
class Admin_UploadController extends Zend_Controller_Action{
	
	public function init(){
		
	}
	
	public function indexAction(){
		
	}
	
	public function uploadAction(){
		// tat layout
		$this->_helper->layout()->disableLayout(true);
		
		$options = array(
				'script_url' => PUBLIC_RESOURCE,
				'upload_dir' => PUBLIC_PATH.'/uploads/images/products/tmp/',
				'upload_url' => PUBLIC_RESOURCE.'/uploads/images/products/tmp/',
				'image_versions' => array(
	                '' => array(
	                    'auto_orient' => true
	                ),
	               
	                'medium' => array(
	                    'max_width' => 400,
	                    'max_height' => 400,
	                	'upload_dir' => PUBLIC_PATH.'/uploads/images/products/400x400/',
	                	'upload_url' => PUBLIC_RESOURCE.'/uploads/images/products/400x400/',
	                ),
	              
	                'thumbnail' => array(
	                	'upload_dir' => PUBLIC_PATH.'/uploads/images/products/thumbs/',
	                	'upload_url' => PUBLIC_RESOURCE.'/uploads/images/products/thumbs/',
	                    'max_width' => 120,
	                    'max_height' => 120
	                ),
				)
		);
		$uploadHandler = new Cms_Image_UploadHandler($options);
	}
}